<html>
<head>
<link href="../../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="contenu">
		
		<center><h3>Mesh Loading and Rendering 2 (2/7)</h3>
		  <br><br>
		  <img src="1_Visual.png" name="Visu_start" align="middle" width=300>
		</center>

		
		<br><div id="orangeText">Description</div>
        
        <p>This step shows how to load mesh files which are not in OBJ format.</p>

		<div id="orangeText">Key points</div>

		<p>As we saw in the last step, <b>OglModel</b> can render simply OBJ file. This was done directly in this component because OBJ is widely used.
		But if you have less common format files, there is a different method to render them.</p>
		
		<p><b>MeshLoader</b> is used to load several kinds of files. Its loaded data is connected to <b>OglModel</b>, which will used it to visualize.
		In this example, we render an OFF file, using <b>MeshOffLoader</b>.</p>
		
        <div id="tutorialAction"><p>Clear the scene to start with just a <strong>root</strong> node again.</p>
        
        <p>Add a <strong>MeshVTKLoader</strong> component and rename it "loader". Change the <strong>Filename of the object</strong> to <strong>/Sofa/share/mesh/aneurysm3d_2_small.off</strong>.</p>
        <p>Add a <strong>OglModel</strong>. </p>
        <p>Save your scene file by selecting <strong>File > Save</strong>. We will refer to this file as <strong>myTutorial.scn</strong>.</p>
        <p>In your favorite XML editor, open <strong>myTutorial.scn</strong>. Look for the line:</p>
        
        <p><strong>OglModel template="ExtVec3f" name="oglModel8"</strong></p>
        
        <p>After the name property, add <strong>src="@loader"</strong>. The line should now look like: </p>
        
        <p><strong>OglModel template="ExtVec3f" name="oglModel8" src="@loader"</strong></p>
        
        <p>Save the file. Re-open <strong>myTutorial.scn</strong> in the Modeler.</p>
        
        <p>Run in SOFA.</p></div>
        
        <p>You can now see the model of an aneurysm. If it is dark and difficult to see, don't be alarmed. That is simply because of the default colors specified for this model.</p>
         
     

        <br><center><h3><a href="2_Visual.scn">Next</a></center></h3>
	</div>
</body>
</html>
